import axios from "../utils/request";

export const Captcha = () => {
    return axios({
        url: "/api/user/captcha",
        method: "GET"

    })
}
//定义类型接口
interface data {
    "username": string,
    "password": string,
    "captcha": string
}

export const Logins = (data: data) => {
    return axios({
        url: "/api/user/login",
        method: "POST",
        data
    })
}

export const Buylistdel = (id: string) => {
    return axios({
        url: `/xing/api/v1/group/${id}`,
        method: "DELETE",
    })
}
interface xinglist {
    "img": string,
    "house_name": string,
    "group_title": string,
    "province": string,
    "city": string,
    "county": string,
    "address": string,
    "start_time": string,
    "end_time": string,
    "group_info": string,
    "initiator": string,
    "group_id": string,
    "group_status": string,
    "max_people_count": string,
    "now_people_count": string,
    "status": boolean
}

//团购新增数据
export const Buyxingzeng = (data: xinglist) => {
    return axios({
        url: '/api/api/v1/group',
        method: "POST",
        data
    })
}
//团购查询数据
export const Buycha = (inpvalue: string) => {
    return axios({
        url: '/api/api/v1/group',
        method: "get",
        params: inpvalue
    })
}
//获取用户列表
export const userdata = () => {
    return axios({
        url: '/api/getUserList',
        method: "get",
    })
}
//用户列表删除
export const userdel = (id: string) => {
    return axios({
        url: `/api/user/${id}`,
        method: "DELETE",
    })
}
//用户查询
export const usercha = (chauser: any) => {
    return axios({
        url: '/api/getUserList',
        method: "GET",
        params: chauser
    })
}   